#include "url.h"

Url::Url( QWidget * parent, Qt::WFlags f) 
	: QDialog(parent, f)
{
#ifdef Q_WS_WIN
	path = QCoreApplication::applicationDirPath();
#else 
	path = QDir::homePath ()+"/.qalarm";
#endif	
	setupUi(this);		
	init();	
	connect(urlSave, SIGNAL(clicked()), this, SLOT(save()));
	setWindowIcon(QIcon(path+"/images/alarm.png"));
}

void Url::save()
{
	Utils utils;
	utils.saveFile(path+"/data/url",urlEdit->text());	
	hide();	
	Utils::changed = true;			
}

void Url::init()
{
	Utils utils;
	urlEdit->setText(utils.readFile(path+"/data/url"));	
}
